package com.mephi.oshs.model.interpreter;

import com.mephi.oshs.model.interpreter.api.IExpression;
import com.mephi.oshs.model.interpreter.impl.*;

public class ExpressionFactory {

    public static IExpression getConstantExpression(final Object newValue) {
        return new ConstantExpression(newValue);
    }

    public static IExpression getAndExpression(final ComparisonExpression expressionA, final ComparisonExpression expressionB) {
        return new AndExpression(expressionA, expressionB);
    }

    public static IExpression getOrExpression(final ComparisonExpression expressionA, final ComparisonExpression expressionB) {
        return new OrExpression(expressionA, expressionB);
    }

    public static IExpression getVariableExpression(final Object newLookup, final String newMethodName) {
        return new VariableExpression(newLookup, newMethodName);
    }

    public static IExpression getEqualsExpression(final IExpression expressionA, final IExpression expressionB) {
        return new EqualsExpression(expressionA, expressionB);
    }

    public static IExpression getContainsExpression(final IExpression expressionA, final IExpression expressionB) {
        return new ContainsExpression(expressionA, expressionB);
    }
}
